ÄúµÄλÖãºÑ°ÃÎÍøÊ×Ò³£¾±à³ÌÀÖÔ°£¾VBScript£¾VBScript


objects constants operators statements functions properties methods







METHOD:  FileSystemObject.CreateFolder

object.CreateFolderfoldername

This method allows us to create a folder with the specified foldername. If a folder already exists with the same name as you are trying to create, you will get an error. The FolderExists method can be used to check this before creating you new folder.

Code:
<%
dim filesys, newfolder
set filesys=CreateObject("Scripting.FileSystemObject")
If  Not filesys.FolderExists("c:\DevGuru\website\") Then
   newfolder = filesys.CreateFolder "c:\DevGuru\website\"
   Response.Write("A new folder '" & newfolder & "' has been created")
End If
%>


Output:
"A new folder 'c:\DevGuru\website\' has been created."